var include = 
{
	js:function(url,o)
	{
		var rs = '';o = o || {};if(url) o.src = url;for(var k in o) rs += ' '+k+'="'+o[k]+'" ';
		document.write('<script type="text/javascript" '+rs+'></script>');
	},
	async:function(url,o)
	{
		o = o || {};if(url) o.src = url;
		var rs = document.createElement( 'script' );
		for(var k in o) rs[k] = o[k];
		document.getElementsByTagName('head')[0].appendChild(rs);
	},
	css:function(url,o)
	{
		var rs = '';o = o || {};if(url) o.href = url;for(var k in o) rs += ' '+k+'="'+o[k]+'" ';
		document.write('<link rel="stylesheet" type="text/css" '+rs+' />');
	}
}
var ___script___ =
{
	page:__scfg__.thisPage || 'index',
	"static":__scfg__.staticUrl,	
	header:
	{   //在页面顶部输出的JS
    	all:
    	{	
    		"js":["script/lib.js",
				  "script/lib.ext.js",
				  "script/lib.ext.pailego.global.js"],
    		"css":["style/base.css"]
    	},
    	channel:
    	{  //
    	    'index':
        	{//
        		"css":['style/index.css']
        	},
			'register':
			{
				"css":['style/component.css']
			},
			'login':
			{
				"css":['style/component.css']
			},
			'my':
			{
				"js" :["script/lib.ext.pailego.my.js",
					   'calendar/calendar.js',
					   'calendar/calendar.lang.zh.js',
					   'calendar/calendar.setup.js'],
				"css":['style/my.css',
					   'calendar/calendar.css']
			},
			'my_sell':
			{
				"js" :["script/lib.ext.pailego.my.sell.js"],
				"css":['style/my.sell.css']
			},
			'my_buy':
			{
				"js" :["script/lib.ext.pailego.my.buy.js"],
				"css":['style/my.buy.css','','']
			},
			'pct':
			{
				"js" :["script/lib.ext.pailego.pct.js","script/lib.ubb.js","script/lib.ext.pailego.review.js"],
				"css":['style/pct.css']
			},
			'search':
			{
				"js" :["script/lib.ext.pailego.search.js"],
				"css":['style/search.css']
			}
    	}
	},
	foot:
	{
	    all:{},
	    channel:{}
	},
	include:function(station,page)
	{
	    station = station || 'header';
		page = page || this.page || 'index';
		var vars = this[station];
		this._include(vars.all);
		this._include(vars.channel[page]);
	},
	_include:function(o)
	{
		var k,a,f,dir;
		for(k in o)
		{
			a = o[k];
			if(k=='script')
			{
				eval(a);
			}else
			{
				f = include[k];
				if(f)for(i=0;i<a.length;i++)f(/^http/.test(a[i])?a[i]:this['static']+a[i],{charset:"utf-8"});
			}
		}
	}
}
___script___.include();